import sysConfig from "@/qly/setting"
import storage from '@/qly/storage'
import {createI18n} from 'vue-i18n'

import zh_CN from './lang/zh_CN.js'
import en_US from './lang/en_US.js'

const messages = {zh_CN, en_US}

const i18n = createI18n({
    // 使用CompotitionAPI必须添加这条.
    allowComposition: true,
    // 设置当前语言类型
    locale: storage.get(sysConfig.LS_APP_LANG) || sysConfig.LANG,
    // 应急语言
    fallbackLocale: sysConfig.LANG,
    // 全局注册$t方法
    globalInjection: true,
    messages,
})
export default i18n;
